home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / asmutil / ps65a12.zip / A65.DOC < prev    next >
Text File  |  1986-11-30  |  33KB  |  985 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.                              PseudoSam 65 Assembler Manual V1.0.00
  12.                              Copyright(c) 1986 PseudoCode
  13.  
  14.  
  15.  
  16.  
  17.  
  18. Disclaimer:
  19.  
  20.             PseudoSam 65 is distributed as is, with no guarantee that it
  21.             will work correctly in all situations.  In no event will the
  22.             Author be liable for any damages, including lost profits,
  23.             lost savings or other incidental or consequential damages
  24.             arising out of the use of or inability to use these
  25.             programs, even if the Author has been advised of the
  26.             possibility of such damages, or for any claim by any other
  27.             party.
  28.  
  29.             It is the users reponsibility to back up all important files!
  30.  
  31.             See copyright information in appendix B
  32.  
  33.  
  34.  
  35.  
  36.  
  37.                          Table of Contents
  38.  
  39. Chapter 1  PseudoSam 65 assembler.
  40.  
  41. Chapter 2  Running the assembler program.
  42.  
  43. Chapter 3  Assembler statement syntax.
  44.  
  45. Chapter 4  Data types.
  46.  
  47. Chapter 5  Expressions.
  48.  
  49. Chapter 6  Assembler Directives.
  50.   (also known as assembler pseudo-opcodes, or pseudo-ops)
  51.  
  52. Appendix A      ASCII character set.
  53.  
  54. Appendix B      Copyright and registration information.
  55.  
  56. Appendix C      Description of Files.
  57.  
  58. Appendix D      Bug Reporting Procedure.
  59.  
  60. Appendix E      Using PseudoSam 65 on "Compatible" Systems.
  61.  
  62.  
  63.  
  64. Chapter 1 PseudoSam 65 assembler.
  65.  
  66.      All PseudoSam(Pseudo brand Symbolic AsseMbler) assemblers conform to
  67.      a common syntax based on the UNIX system V assembler syntax. By
  68.      conforming to this Pseudo standard, conflicts with the manufacturers
  69.      syntax are created.  Below is a brief and incomplete list of those
  70.      conflicts.
  71.  
  72.          PseudoSam format
  73.  
  74.  .dw  h'00ff    ;is stored in memory msb first(00ff), use .drw to
  75.                 ;create a word lsb first(ff00)(6502 normal).
  76.  
  77.  .equ <identifier> , <expression>
  78.  
  79.  .set <identifier> , <expression>
  80.  
  81.   No Macro capability at this time
  82.  
  83.   Labels may start anywhere, but must
  84.   be followed immediately by a colon.
  85.  
  86.  
  87.  
  88. * The PseudoSam name of an assembler directive can be cchanged by the
  89.   .opdef directive.
  90.  
  91.   example
  92.  
  93.    .opdef  eject,.eject      ;defines eject to be synonymous with .eject
  94.    .opdef  fcc,.db           ;fcc will now form constant characters as it
  95.                              ;should.
  96.  
  97. *  A file syn.asm is distributed with the assembler with some useful
  98.    redefinitions.
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109. Unix system V is a trademark of AT & T.
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117. Chapter 2  Running the assembler program
  118.  
  119. 1.  Command line switch setting and source file specification.
  120.  
  121.      Assuming the user has an assembly language source file called foo.asm
  122.      type the following command:
  123.  
  124. a65 foo
  125.  
  126.      The assembler will assemble the program foo.asm using the default
  127.      assembler switch settings. the following files will be generated
  128.      by the assembler:
  129.  
  130.      foo.lst   ;assembled listing shown the code conversion and
  131.                ; any errors that where discover by the assembler.
  132.  
  133.      foo.obj   ;assembled object code in Motorola Hex format.
  134.  
  135. **  for a list of switch setting see the .command assembler directive
  136.     description in chapter 6.
  137.  
  138. *** The assembler uses the following temporary file names.
  139.  
  140.     z0z0z0z0.tmp
  141.     z1z1z1z1.tmp
  142.  
  143.     ANY files with these names will be DESTROYED by the
  144.     by the assembler.
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152. Chapter 3  Assembler statement syntax
  153.  
  154. 1. Assembler Statements
  155.  
  156.      Assembler statements contain from zero to 4 fields as shown in
  157.      following.
  158.  
  159. <label> <opcode> <expressions> <comment>
  160.  
  161.      All fields are optional, but they must be in this order.
  162.  
  163. A.   Labels (<label>) are symbolic names that are assigned the starting
  164.      address of any code generated by the opcode and or expressions
  165.      of the line containing the label declaration.(see section 2).
  166.  
  167. B.   Operation codes(<opcode>) tell the assembler what machine instruction
  168.      to generate, or what assembler control function to perform.
  169.      The operation code also tells the assembler what expressions are
  170.      required to complete the machine instruction or assembler directive.
  171.      (see chapter 6).
  172.  
  173. C.   Expression requirements are set by the opcode(see the microprocessor
  174.      manufacturers reference manual or the assembler directives chapter
  175.      for individual opcode requirements).(see chapter 5).
  176.  
  177. D.   Comments are notes written by the programmer to explain what the
  178.      program is trying to accomplish. Comments generate no code.
  179.      (see section 3).
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187. 2.  Labels
  188.  
  189.      Labels can be unlimited in length, but only the first eight characters
  190.      are used to distinguish between them.  They must conform to the
  191.      following syntax.
  192.  
  193.      <label>  -> <identifier>':'
  194.  
  195.      <identifier> -> <alphabetic character> <identifier character string>
  196.  
  197.      <alphabetic character> -> character in the set ['A'..'Z', 'a'..'z', '.']
  198.  
  199.      <identifier character string> -> any sequence of characters from the
  200.                                       set ['A'..'Z','a'..'z', '.', '0'..'9']
  201.  
  202. example
  203. abc:                  ;label referred to as abc
  204. a c:                  ;not a valid label
  205.          foo:         ;label referred to as foo
  206. .123:                 ;label referred to as .123
  207.  
  208. * Case makes NO difference!
  209.  
  210. d:      ;is the same as
  211. D:
  212.  
  213.  
  214. 3.  Comments
  215.      Comments must start with a semi-colon ; and are terminated
  216.      by an end of line or file( <lf>(^J) or <sub>(^Z) ). An end
  217.      of line is inserted by typing the enter or return key by
  218.      most text editors.
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226. Chapter 4     Data types
  227.  
  228. 1.  Integers
  229.  
  230.     Integer constants can be specified in any of the following forms:
  231.  
  232. A.  Binary
  233.  
  234.     b'bb             ;bb=string of binary digits
  235.     B'bb
  236.  
  237. B.  Decimal
  238.  
  239.     ndd
  240.     d'dd             ;n=nozero decimal digit
  241.     D'dd             ;dd=string of decimal digits
  242.  
  243. C.  Octal
  244.  
  245.     0qq              ;qq=string of octal digits
  246.     o'qq
  247.     O'qq
  248.     q'qq
  249.     Q'qq
  250.  
  251. D.  Hexidecimal
  252.  
  253.     0x'hh            ;hh=string of hexidecimal digits
  254.     0X'hh
  255.     h'hh
  256.     H'hh
  257.     x'hh
  258.     X'hh
  259.  
  260.  
  261. Examples:
  262.  
  263.     077        ;octal number 77 = decimal 63
  264.     b'0101     ;binary number 101 = decimal 5
  265.     77         ;decimal number 77 = octal 115
  266.     h'ff       ;hexidecimal ff = decimal 255
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273. 2.  Strings:
  274.  
  275.     Strings consist of a beginning quote " followed by any reasonable number
  276.     of characters followed by an ending quote ". Control characters and double
  277.     quotes " and backslash \ may not be used in strings directly.  These
  278.     special characters are included by using a special escape sequence which
  279.     the assembler translates into the appropriate ASCII code.
  280.  
  281. Note: Strings may not be used in expressions!
  282.       Although character constants may(see below).
  283.  
  284. Escape sequences
  285.   "\"" string containing "
  286.   "\\" string containing \
  287.   "\'" string containing '
  288.   "\0" string containing null
  289.   "\n" string containing linefeed
  290.   "\r" string containing carriage return
  291.   "\f" string containing formfeed
  292.   "\t" string containing horizontal tab
  293.   "\nnn" string containing the ASCII character who's code is o'nnn
  294.          (nnn are octal digits).
  295.   * see appendix A for ASCII codes.
  296.  
  297. 3.  Character Constants:
  298.  
  299.     Character constants consist of  a single quote ' followed by
  300.     a character or an escape sequence(see above) followed by a
  301.     single quote '.
  302.  
  303. example:
  304.    'A' = ASCII character value for the letter A = 65 (decimal);
  305.    '\''= ASCII character value for the character ' = 39 (decimal).
  306.  
  307. Character constants are treated as integers by the assembler and
  308. are valid where ever an integer value is valid.
  309.  
  310. example:
  311.    'A' + 1 = 66
  312.  
  313.   * see appendix A for ASCII codes.
  314.  
  315. 4.  Symbolic values
  316.  
  317.     Symbolic values are generally labels, but may be any identifier
  318.     assigned an integer value(using .set or .equ pseudo-ops).
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325. Chapter 5  Expressions
  326.  
  327.      All expressions evaluate to integer values modulo 65536(2^16) and are
  328.      written in infix notation(the way you